package h_exception;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class test {
    public static void main(String[] args) {
       int num=0;
        List<Student> list=new ArrayList<>();
       while(num<3){
           try{
               Scanner sc=new Scanner(System.in);
               System.out.print("请输入姓名：");
               String name = sc.nextLine();
               System.out.print("请输入年龄：");
               int age=sc.nextInt();
               list.add(new Student(name,age));
               num++;
           }catch (Exception e){
                e.getMessage();
           }
       }
    }
}
